import sys
import os
import json
sys.path.append('src')

from tasks.lsbvd.feature.static_cfg import BigBinaryCfgBuilder

region_split_path='caches_data/amd.txtbin_partitions.json'

# region_split by user define region
region_json=json.load(open(region_split_path, 'r'))['partitions']


bbinary_builder= BigBinaryCfgBuilder(
        binary_path='caches_data/ine.txtbin',
        caches_dir='caches_data/nokia_cfg',
        symbols_json_path='caches_data/symbols_export.json'
    )


# 0 is finish

region_number = len(region_json)
print(f"Total regions: {region_number}")


select_indexes=list(range(region_number))

bbinary_builder.build_partial(select_indexes, regions=region_json)